/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.iwords.service.object;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 *
 * @author huangbaichuan
 */
@Entity
@Table(name="learningstatus")
public class LearningStatusEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Integer getFamiliarity() {
        return familiarity;
    }

    public void setFamiliarity(Integer familiarity) {
        this.familiarity = familiarity;
    }

    

    /**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}
 
    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    public Long getUserid() {
        return userid;
    }

    public void setUserid(Long userid) {
        this.userid = userid;
    }

//    public Long getWordid() {
//        return wordid;
//    }
//
//    public void setWordid(Long wordid) {
//        this.wordid = wordid;
//    }
    
   
    public SysLibWordsEntity getWord() {
		return word;
	}

	public void setWord(SysLibWordsEntity word) {
		this.word = word;
	}
	
	private Long userid;
	private Long libid;
    @ManyToOne(cascade = { CascadeType.REFRESH}, optional = false)
    @JoinColumn(name="wordid")
    private SysLibWordsEntity word;
    private Integer familiarity;
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date createtime;
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date updatetime;



    /**
	 * @return the libid
	 */
	public Long getLibid() {
		return libid;
	}

	/**
	 * @param libid the libid to set
	 */
	public void setLibid(Long libid) {
		this.libid = libid;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LearningStatusEntity)) {
            return false;
        }
        LearningStatusEntity other = (LearningStatusEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.iwords.service.object.LearningStatusEntity[id=" + id + "]";
    }

}
